package cn.hbu.zlfw.job.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;
/**
 * 
 *@ClassName:ShortMessage.java
 *@Description:  短信实体
 *@Author:lxt<839376636@qq.com>
 *@Date:2017年10月9日下午6:50:06
 *@Version:1.1.0
 */
@Entity
@Table(name="t_short_message")
public class ShortMessage implements Serializable{

	private static final long serialVersionUID = -7553875502831399880L;
	
	
	public static final Integer REGISTER = 1000;//注册验证码
	
	public static final Integer FORGET_PASSWORD = 1001;//找回密码验证码

	@Id
	@Column(name = "id", length = 32)
	@GeneratedValue(generator = "UUID_KEY")
	@GenericGenerator(name = "UUID_KEY", strategy = "uuid.hex")
	private String id;
	
	@Column(name="phoneNumber",length=100)
	private String phoneNumber;
	
	@Column(name="code",length=20)
	private int code; 	//验证码
	
	@Column(name="type",length=20)
	private int type;//短信类型：找回=FORGET_PASSWORD/注册=REGISTER
	
	@Column(name="userType",length=20)
	private int userType;//用户类型
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="createTime")
	private Date createTime;
	
	@Column(name="delState",length=20,nullable=false)
	private Integer delState;	//删除状态,1表示已经删除，0表示未删除
	/**
	 * 多对一设置
	
	@ManyToOne(cascade= CascadeType.ALL)
	@JoinColumn(name="r_id")
	private Researcher researcher;
	 */
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}


	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public Integer getDelState() {
		return delState;
	}

	public void setDelState(Integer delState) {
		this.delState = delState;
	}

	@Override
	public String toString() {
		return "ShortMessage [id=" + id + ", phoneNumber=" + phoneNumber + ", code=" + code + ", type=" + type
				+ ", userType=" + userType + ", createTime=" + createTime + ", delState=" + delState + "]";
	}
}
